<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-tab layui-tab-brief">
            <div class="layui-tab-content">
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-row">
                        <div class="layui-col-xs6">
                            <div class="layui-form-item">
                                <label class="layui-form-label">id</label>
                                <div class="layui-input-block">
                                    <input type="text" id="id" disabled="disabled" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">商户ID</label>
                                <div class="layui-input-block">
                                    <input type="text" id="mchId" disabled="disabled" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">商户名称</label>
                                <div class="layui-input-block">
                                    <input type="text" id="mchName" disabled="disabled" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">商户类型</label>
                                <div class="layui-input-block">
                                    <input type="text" id="mchType" disabled="disabled" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">状态</label>
                                <div class="layui-input-block">
                                    <input type="text" id="status" disabled="disabled" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">对账日期</label>
                                <div class="layui-input-block">
                                    <input type="text" id="billDate" disabled="disabled" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">下载地址</label>
                                <div class="layui-input-block">
                                    <input type="text" id="billPath" disabled="disabled" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">创建时间</label>
                                <div class="layui-input-block">
                                    <input type="text" id="createTime" disabled="disabled" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">更新时间</label>
                                <div class="layui-input-block">
                                    <input type="text" id="updateTime" disabled="disabled" class="layui-input">
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['admin', 'form'], function () {
        var form = layui.form,
            $ = layui.$,
            admin = layui.admin,
            element = layui.element,
            view = layui.view,
            layer = layui.layer;
        // 导航
        element.render('breadcrumb', 'breadcrumb');
        var id = view.getOpenParams('id');
        admin.req({
            type: 'get',
            url: layui.setter.baseUrl + '/bill/mch/get',
            data: {
                id: id
            },
            error: function (err) {
                layer.alert(JSON.stringify(err.field), {
                    title: '错误提示'
                })
            },
            success: function (res) {
                if (res.code == 0) {
                    $('#id').val(res.data.id);
                    $('#mchId').val(res.data.mchId);
                    $('#mchName').val(res.data.mchName);
                    $('#mchType').val(res.data.mchType == 1?"平台账户":"私有账户");
                    $('#billDate').val(layui.util.toDateString(res.data.billDate, "yyyy-MM-dd"));
                    $('#billPath').val(res.data.billPath);
                    $('#status').val(res.data.status == 0?"未生成":"已生成");
                   
                    if (res.data.createTime != "" && res.data.createTime != null) {
                        $('#createTime').val(layui.util.toDateString(res.data.createTime));
                    }
                    if (res.data.updateTime != "" && res.data.updateTime != null) {
                        $('#updateTime').val(layui.util.toDateString(res.data.updateTime));
                    }
                    form.render();
                }
            }
        })
    })
</script>